import React, { Component } from 'react'
import { HashRouter as  Router,Route,Switch } from 'react-router-dom'
import routes from './router.config'



export default class App extends Component{

    render() {
        return(
            <Router>
                <Switch>
                    {
                        routes.map(route => {
                            return <Route key={ route.name } path={ route.path } exact render = { props => {
                                return <route.component {...props} routes={ route.routes }/>
                            }
                            }/>
                        })
                    }
                </Switch>
            </Router>
        )
    }
}



